﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Genuilder.Tests
{
	public class TestFile : IDisposable
	{
		private readonly FileInfo _FileInfo;
		public FileInfo FileInfo
		{
			get
			{
				return _FileInfo;
			}
		}
		public TestFile()
		{
			_FileInfo = new FileInfo(Guid.NewGuid().ToString());
			_FileInfo.Create().Close();
		}

		public TestFile Of(string source)
		{
			File.Copy(source, _FileInfo.FullName, true);
			return this;
		}


		#region IDisposable Members

		public void Dispose()
		{
			_FileInfo.Delete();
		}

		#endregion
	}
}
